import com.atguigu.gmall.bean.VisitorStats;

import java.lang.reflect.Field;

/**
 * @Author lizhenchao@atguigu.cn
 * @Date 2021/8/4 16:14
 */
public class C {
    public static void main(String[] args) throws NoSuchFieldException, IllegalAccessException {
        VisitorStats vs = new VisitorStats();
        vs.setStt("abc");
        
        Class<VisitorStats> tClass = VisitorStats.class;
    
        Field stt = tClass.getDeclaredField("stt");  // 对象.属性名
        stt.setAccessible(true);
        Object v = stt.get(vs);
        System.out.println(v);
        
    
        /*Field[] fields = tClass.getDeclaredFields();
        for (Field field : fields) {
            System.out.println(field.getName());
        }*/
    }
}
